.class public Lorg/microemu/android/device/AndroidImmutableImage;
.super Ljavax/microedition/lcdui/Image;
.source "AndroidImmutableImage.java"


# instance fields
.field private bitmap:Landroid/graphics/Bitmap;


# direct methods
.method public constructor <init>(Landroid/graphics/Bitmap;)V
    .locals 0
    .parameter "bitmap"

    .prologue
    .line 35
    invoke-direct {p0}, Ljavax/microedition/lcdui/Image;-><init>()V

    .line 36
    iput-object p1, p0, Lorg/microemu/android/device/AndroidImmutableImage;->bitmap:Landroid/graphics/Bitmap;

    .line 37
    return-void
.end method

.method public constructor <init>(Lorg/microemu/android/device/AndroidMutableImage;)V
    .locals 1
    .parameter "image"

    .prologue
    .line 39
    invoke-direct {p0}, Ljavax/microedition/lcdui/Image;-><init>()V

    .line 40
    invoke-virtual {p1}, Lorg/microemu/android/device/AndroidMutableImage;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-static {v0}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lorg/microemu/android/device/AndroidImmutableImage;->bitmap:Landroid/graphics/Bitmap;

    .line 41
    return-void
.end method


# virtual methods
.method public getBitmap()Landroid/graphics/Bitmap;
    .locals 1

    .prologue
    .line 44
    iget-object v0, p0, Lorg/microemu/android/device/AndroidImmutableImage;->bitmap:Landroid/graphics/Bitmap;

    return-object v0
.end method

.method public getHeight()I
    .locals 1

    .prologue
    .line 54
    iget-object v0, p0, Lorg/microemu/android/device/AndroidImmutableImage;->bitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v0

    return v0
.end method

.method public getRGB([IIIIIII)V
    .locals 8
    .parameter "argb"
    .parameter "offset"
    .parameter "scanlength"
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v2, 0x1

    .line 60
    if-lez p6, :cond_0

    if-gtz p7, :cond_1

    .line 88
    :cond_0
    :goto_0
    return-void

    .line 62
    :cond_1
    if-ltz p4, :cond_2

    if-ltz p5, :cond_2

    add-int v0, p4, p6

    invoke-virtual {p0}, Lorg/microemu/android/device/AndroidImmutableImage;->getWidth()I

    move-result v1

    if-gt v0, v1, :cond_2

    add-int v0, p5, p7

    invoke-virtual {p0}, Lorg/microemu/android/device/AndroidImmutableImage;->getHeight()I

    move-result v1

    if-le v0, v1, :cond_3

    .line 63
    :cond_2
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Specified area exceeds bounds of image"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 64
    :cond_3
    if-gez p3, :cond_4

    neg-int v0, p3

    :goto_1
    if-ge v0, p6, :cond_5

    .line 65
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "abs value of scanlength is less than width"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_4
    move v0, p3

    .line 64
    goto :goto_1

    .line 66
    :cond_5
    if-nez p1, :cond_6

    .line 67
    new-instance v0, Ljava/lang/NullPointerException;

    const-string v1, "null rgbData"

    invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 68
    :cond_6
    if-ltz p2, :cond_7

    add-int v0, p2, p6

    array-length v1, p1

    if-le v0, v1, :cond_8

    .line 69
    :cond_7
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 70
    :cond_8
    if-gez p3, :cond_9

    .line 71
    sub-int v0, p7, v2

    mul-int/2addr v0, p3

    add-int/2addr v0, p2

    if-gez v0, :cond_a

    .line 72
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 74
    :cond_9
    sub-int v0, p7, v2

    mul-int/2addr v0, p3

    add-int/2addr v0, p2

    add-int/2addr v0, p6

    array-length v1, p1

    if-le v0, v1, :cond_a

    .line 75
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 78
    :cond_a
    iget-object v0, p0, Lorg/microemu/android/device/AndroidImmutableImage;->bitmap:Landroid/graphics/Bitmap;

    move-object v1, p1

    move v2, p2

    move v3, p3

    move v4, p4

    move v5, p5

    move v6, p6

    move v7, p7

    invoke-virtual/range {v0 .. v7}, Landroid/graphics/Bitmap;->getPixels([IIIIIII)V

    goto :goto_0
.end method

.method public getWidth()I
    .locals 1

    .prologue
    .line 49
    iget-object v0, p0, Lorg/microemu/android/device/AndroidImmutableImage;->bitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    return v0
.end method
